package day1103.demo03;

/**
 * @program: qy158
 * @description:
 * @author: 闫克起2
 * @create: 2022-11-03 10:27
 **/
public class Test {
    public static void main(String[] args) {
        Operator o=arr -> arr.length;
        fun(o);
    }
    public static void fun(Operator operator) {
        int sum[] = {11, 12, 13, 14};
        int sum1 = operator.getSum(sum);
        System.out.println("数组中元素的个数:" + sum1);
    }
}

interface Operator {
    //求数组中元素的和
    public int getSum(int[] arr);
}